package com.ruoyi.playlist.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.playlist.mapper.PlaylistTracksMapper;
import com.ruoyi.playlist.domain.PlaylistTracks;
import com.ruoyi.playlist.service.IPlaylistTracksService;

/**
 * 歌单-歌曲Service业务层处理
 * 
 * @author lin
 * @date 2025-03-04
 */
@Service
public class PlaylistTracksServiceImpl implements IPlaylistTracksService 
{
    @Autowired
    private PlaylistTracksMapper playlistTracksMapper;

    /**
     * 查询歌单-歌曲
     * 
     * @param playlistId 歌单-歌曲主键
     * @return 歌单-歌曲
     */
    @Override
    public PlaylistTracks selectPlaylistTracksByPlaylistId(Long playlistId)
    {
        return playlistTracksMapper.selectPlaylistTracksByPlaylistId(playlistId);
    }

    /**
     * 查询歌单-歌曲列表
     * 
     * @param playlistTracks 歌单-歌曲
     * @return 歌单-歌曲
     */
    @Override
    public List<PlaylistTracks> selectPlaylistTracksList(PlaylistTracks playlistTracks)
    {
        return playlistTracksMapper.selectPlaylistTracksList(playlistTracks);
    }

    /**
     * 新增歌单-歌曲
     * 
     * @param playlistTracks 歌单-歌曲
     * @return 结果
     */
    @Override
    public int insertPlaylistTracks(PlaylistTracks playlistTracks)
    {
        return playlistTracksMapper.insertPlaylistTracks(playlistTracks);
    }

    /**
     * 修改歌单-歌曲
     * 
     * @param playlistTracks 歌单-歌曲
     * @return 结果
     */
    @Override
    public int updatePlaylistTracks(PlaylistTracks playlistTracks)
    {
        return playlistTracksMapper.updatePlaylistTracks(playlistTracks);
    }

    /**
     * 批量删除歌单-歌曲
     * 
     * @param playlistIds 需要删除的歌单-歌曲主键
     * @return 结果
     */
    @Override
    public int deletePlaylistTracksByPlaylistIds(Long[] playlistIds)
    {
        return playlistTracksMapper.deletePlaylistTracksByPlaylistIds(playlistIds);
    }

    /**
     * 删除歌单-歌曲信息
     * 
     * @param playlistId 歌单-歌曲主键
     * @return 结果
     */
    @Override
    public int deletePlaylistTracksByPlaylistId(Long playlistId)
    {
        return playlistTracksMapper.deletePlaylistTracksByPlaylistId(playlistId);
    }

    @Override
    public List<Map<String, Object>> selectTrackDetailsByPlaylistId(Long playlistId) {
        return playlistTracksMapper.selectTrackDetailsByPlaylistId(playlistId);
    }
}
